<?php

class Country extends CActiveRecord
{
    public $id;

    public $code;

    public $name;

    public function relations()
    {
        return array(
            'leagues' => array(self::HAS_MANY, 'League', 'country_id')
        );
    }

    public function tableName()
    {
        return 'countries';
    }

    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }
}